
<?php
session_start();
require_once '../models/Users.php';
require_once '../models/Common.php';
$msg="";
$customerID= $_REQUEST['customerID'];
$rows	= Users::getInfo($customerID);
if(isset($_POST['btn_submit'])){
	$status=$_POST["status"];
	$re=Users::updateCustomerStatus($customerID,$status);
	if($re){
		$mgs="Cập nhật thành công!";
		//$page="update_menuAdmin.php?menuID=".$menuID;
		$page="ql_user_customer.php";
		Users::redirectTo($page);
	}else $mgs="Cập nhật thất bại !!!";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Cập nhật thông tin tài khoản</title>
<?php include '../admin/_meta.php';?>
</head>
<body>
<form method="post">
	<div id="firstLine">
		<div id="top-bar">
		<?php include '_top_bar_admin.php';?>
		</div>
	</div>
	<div id="container">
		<div id="header">
			<?php include '_menu_admin.php';?>
		</div>
		<div id="center">

			<div id="table-user">
			<table id="table-user-table">
					<tr>
							<td><input  type="hidden" name="customerID" value="<?php echo $rows["customerID"];?>" disabled="disable"></td>
						</tr>
						<tr>
							<th colspan="2">Thông tin cá nhân</th>
						</tr>
						<tr>
							<td>Họ và tên:</td>
							<td><span><?php echo $rows['f_name'].' '.$rows['l_name'] ?></span></td>
						</tr>
						<tr>
							<td>Giới tính:</td>
							<td><span><?php echo $rows['gender']?></span>
							</td>
						</tr>
						<tr>
							<td><span>Ngày sinh:</span></td>
							<td><?php echo $rows['day'].'/'.$rows['month'].'/'.$rows['year']?>
							</td>
						</tr>
						<tr>
							<td>Email:</td>
							<td><span><?php echo $rows['email'] ?></span></td>
						</tr>
						<tr>
							<td>Phone:</td>
							<td><span><?php echo $rows['phone'] ?></span></td>
						</tr>
						<tr>
							<td>Địa chỉ:</td>
							<td><span><?php echo $rows['address'] ?></span></td>
						</tr>
						<tr>
							<td>Thành phố:</td>
							<td><span><?php echo $rows['city'] ?></span></td>
						</tr>
						<tr>
							<td>Block:</td>
							<td><?php
								if($rows['status']=="active"){
								echo "<select name='status' class='select_info'><option value='active'>Active</option><option value='block'>Block</option></select>";
								}else{
								echo "<select name='status' class='select_info'><option value='block'>Block</option><option value='active'>Active</option></select>";
								} 
								?>
							</td>
						</tr>
					<tr>
						<td><input type="submit" name="btn_submit" value="Update" class="btn_submit"></td>
						<td><a href="ql_user_customer.php"><input type="button" name="button" value="Cannel" class="btn_submit"></a></td>
					</tr>
					<tr>
						<td colspan="2"><?php if(isset($_POST['btn_submit'])) echo $mgs; ?></td>
					</tr>
				</table>
			</div>
			</div>
		</div>
	</div>
	</div>
	<div>
		<?php include '_footer_admin.php';?>
	</div>
</form>
</body>
</html>
				
				
